package lunadevs.luna.module.exploits;

import com.zCore.Core.zCore;

import lunadevs.luna.category.Category;
import lunadevs.luna.module.Module;
import net.minecraft.network.play.client.C03PacketPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;

public class Zoot extends Module{

	public Zoot() {
		super("Zoot", 0, Category.EXPLOITS, false);
	}

	@Override
	public void onUpdate() {
		if(!this.isEnabled) return;
		if ((mc.thePlayer.onGround) && (!mc.thePlayer.isSwingInProgress))
	    {
	      Potion[] potionTypes;
	      int length = (potionTypes = Potion.potionTypes).length;
	      for (int i = 0; i < length; i++)
	      {
	        Potion potion = potionTypes[i];
	        if (potion != null)
	        {
	          PotionEffect effect = mc.thePlayer.getActivePotionEffect(potion);
	          if ((effect != null) && (potion.isBadEffect())) {
	            for (int j = 0; j < effect.getDuration() / 20; j++) {
	              mc.thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, true));
	            }
	          }
	        }
	      }
	    }
		super.onUpdate();
	}
	
	@Override
	public String getValue() {
		return null;
	}

}
